import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JPanel;

/**
 * 
 * @author Java42, modified by AmandaMarie Adams
 * @see http://stackoverflow.com/questions/15479820/set-background-image-for-jpanel-in-java-breakout-game
 */
public class ImagePanel extends JPanel 
{
   private static final long serialVersionUID = 1L;
   private Image             imageOrg         = null;
   private Image             image            = null;

   public ImagePanel(final Image i) 
   {
      imageOrg = i;
      image = i;
   }

   @Override
   public void paintComponent(final Graphics g) 
   {
      super.paintComponent(g);
      if (image != null)
      {
        g.drawImage(image, 0, 0, null); 
      }
   }
}